﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FrameDetectionTest.Interface
{
    public partial class CreatePrj : Form
    {
        public string ProjectFileName { private set; get; }
        public CreatePrj()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            if(string.IsNullOrEmpty(textBox1.Text))
            {
                label1.Text = "工程名为空，请检查";
                Common.msDelay(500);
                label1.Text = "请确认该机种无同尺寸Base机种工程文件可以遵循，如果有，请遵循规则:MN+机种尺寸";
                return;
            }
            if (!textBox1.Text.Contains("MN"))
            {
                label1.Text = "不符合命名规范，请检查";
                Common.msDelay(500);
                label1.Text = "请遵循规则:MN需要大写";
                return;
            }
            if (!textBox1.Text.Contains("="))
            {
                label1.Text = "请确认该机种无可遵循的同尺寸Base机种，即正在创建的机种为可被遵循的同尺寸Base机种";
                Common.msDelay(1000);
            }
            ProjectFileName = textBox1.Text.Trim();
            this.DialogResult = DialogResult.OK;
            this.Close();
        }
    }
}
